package com.mck.mapper;

import com.mck.entity.FeedBack;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @version 1.0.0
 * @Author mck
 * @Date 2025/5/4 下午4:56
 * @注释
 */

@Mapper
public interface FeedBackMapper {

    /**
     * 添加反馈
     */
    @Insert("insert into feedback (user_id, type, title, content, contact, create_time) values (#{userId}, #{type}, #{title}, #{content}, #{contact}, #{createTime})")
    void addFeedBack(FeedBack feedBack);

    /**
     * 获取反馈列表
     */
    @Select("select * from feedback")
    List<FeedBack> getFeedBackList();

    /**
     * 获取指定反馈列表
     */
    // @Select("select * from feedback where user_id = #{userId}")
    List<FeedBack> getFeedBackListBySpecific(FeedBack feedBack);

    /**
     * 删除反馈
     */
    @Delete("delete from feedback where id = #{feedBackId}")
    void deleteFeedBack(Integer feedBackId);

    /**
     * 更新反馈
     */
    void updateFeedBack(FeedBack feedBack);
}
